package com.fyzk.activity.news;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import android.widget.ListAdapter;
import android.widget.PopupWindow;

import com.tyjc.lottery.R;

/**
 * Created by fanxs11 on 17/4/21.
 */

public class NewsCatgoryPopupWindow extends PopupWindow {

    private GridView mGridView;
    private ListAdapter mListAdapter;

    public NewsCatgoryPopupWindow(Context context) {
        View view = View.inflate(context, R.layout.view_news_catgory, null);
        mGridView = (GridView) view.findViewById(R.id.news_category_container);

        setContentView(view);

        setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
    }

    public void setAdapter(ListAdapter listAdapter) {
        mListAdapter = listAdapter;
        mGridView.setAdapter(mListAdapter);
    }
}
